package zuoye05;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

public class zuoye01 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        list.add("zhangsan,23");
        list.add("lisi,24");
        list.add("wangwu,25");
        int b=10;
        int d=0;
        int i=0;
        HashMap<String, Integer> map = new HashMap<>();
        for (String s : list) {
            for ( i = s.length()-2; i<=s.length()-1; i++) {
                       char c = s.charAt(i);
                       int a=c-'0';
                       d+=a*b;
                       b=b/10;
            }
            System.out.println(d);
            if(d>24)
            {
                s=s.substring(0,s.length()-3);
                map.put(s,d);

            }
            b=10;d=0;
        }System.out.println(map);
    }
}
